package com.xuecheng.content.convert;

import com.xuecheng.api.content.model.CourseBaseDTO;
import com.xuecheng.api.content.model.dto.CourseTeacherDTO;
import com.xuecheng.api.content.model.vo.CourseTeacherVO;
import com.xuecheng.content.entity.CourseBase;
import com.xuecheng.content.entity.CourseTeacher;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CourseTeacherConvert {
    //构建属性转换示例
    CourseTeacherConvert INSTANCE = Mappers.getMapper(CourseTeacherConvert.class);
    //将
    @Mapping(source = "id",target = "courseTeacherId")
    CourseTeacherDTO entity2dTo(CourseTeacher courseTeacher);
    @Mapping(source = "courseTeacherId",target = "id")
    CourseTeacher dTo2entity(CourseTeacherDTO dto);
    CourseTeacherDTO vo2dtoTo(CourseTeacherVO vo);
    List<CourseTeacherDTO> entitys2dtos(List<CourseTeacher> courseTeacher);
}
